import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { CollectFishSiteVO, CollectFishSiteForm, CollectFishSiteQuery } from '@/api/collect/CollectFishSite/types';

/**
 * 查询钓场收藏管理列表
 * @param query
 * @returns {*}
 */

export const listCollectFishSite = (query?: CollectFishSiteQuery): AxiosPromise<CollectFishSiteVO[]> => {
  return request({
    url: '/collect/CollectFishSite/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询钓场收藏管理详细
 * @param fishSiteId
 */
export const getCollectFishSite = (fishSiteId: string | number): AxiosPromise<CollectFishSiteVO> => {
  return request({
    url: '/collect/CollectFishSite/' + fishSiteId,
    method: 'get'
  });
};

/**
 * 新增钓场收藏管理
 * @param data
 */
export const addCollectFishSite = (data: CollectFishSiteForm) => {
  return request({
    url: '/collect/CollectFishSite',
    method: 'post',
    data: data
  });
};

/**
 * 修改钓场收藏管理
 * @param data
 */
export const updateCollectFishSite = (data: CollectFishSiteForm) => {
  return request({
    url: '/collect/CollectFishSite',
    method: 'put',
    data: data
  });
};

/**
 * 删除钓场收藏管理
 * @param fishSiteId
 */
export const delCollectFishSite = (fishSiteId: string | number | Array<string | number>) => {
  return request({
    url: '/collect/CollectFishSite/' + fishSiteId,
    method: 'delete'
  });
};
